<?php
namespace app\api\controller\mall;

use app\api\controller\ApiBase;
use app\common\business\Goods;
use app\common\lib\Show;

class Detail extends ApiBase {
    public function index() {
        $id = input('param.id', 0, 'intval');
        if (empty($id)){
            return Show::error();
        }
        $result = (new Goods())->getGoodsDetailBySkuId($id);
        if (empty($result)){
            return Show::error();
        }
        return Show::success($result);
    }
}